﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    public enum Direction
    {
        North,
        NorthEast,
        East,
        SouthEast,
        South,
        SouthWest,
        West,
        NorWest
    }

    public class WeatherDataDemo
    {
        public double Temperature { get; set; }
        public int WindSpeed { get; set; }
        public Direction WindDirecton { get; set; }

        public override string ToString()
        {
            return string.Format("Temperature = {0}, Wind is {1} mph from the {2}", this.Temperature, this.WindSpeed, this.WindDirecton);
        }

        public List<WeatherDataDemo> DataSequence
        {
            get
            {
                return sequence;
            }
        }
        private List<WeatherDataDemo> sequence = new List<WeatherDataDemo>();
    }

    public class WeatherDataStreram : IEnumerable<WeatherDataDemo>
    {
        private Random generator = new Random();

        public WeatherDataStreram(string _generator)
        {
            //elied
        }

        private IEnumerator<WeatherDataDemo> GetElements()
        {
            for (int i = 0; i < 100; i++)
            {
                yield return new WeatherDataDemo
                {
                    Temperature = generator.NextDouble() * 90,
                    WindSpeed = generator.Next(70),
                    WindDirecton = (Direction)generator.Next(7)
                };
            }
        }

        #region IEnumable<WeatherDateDemo> Members
        public IEnumerator<WeatherDataDemo> GetEnumerator()
        {
            return GetElements();
        }
        #endregion

        #region IEnumerable<WeatherDataDemo> Members
        System.Collections.IEnumerator
            System.Collections.IEnumerable.GetEnumerator()
        {
            return GetElements();
        }
        #endregion



    }
}
